import * as React from 'react'
import classNames from 'classnames'
import './style/index.less'
import { CardProps, CardState } from './interface'
import Group from './card-group'
import Item from './card-item'

class Card extends React.Component<CardProps, CardState> {
  static Group: typeof Group
  static Item: typeof Item
  static defaultProps = {
    prefixCls: 'layui-card'
  }
  constructor(props: CardProps) {
    super(props) 
    this.state = {}
  }

  render() {
    const {
      prefixCls, title,
      children, className,
      ...resetProps
    } = this.props


    const classes = classNames(prefixCls, className, {
      
    })
    
    return (
      <div 
        className={classes}
        {...resetProps}
      >
        {title ? <div
          className={`${prefixCls}-header`}
        >{title}</div> : ''}
        <div className={`${prefixCls}-body`}>
          {children}
        </div>
      </div>
    )
  }
}
export default Card